#ifndef _POWER_SLEEP_CONTROLLER_H_
#define _POWER_SLEEP_CONTROLLER_H_

#include "types.h"

#define PSC0_BASE	0x01C10000
#define PSC1_BASE	0x01E27000

#define PSC0_REVID	*((volatile uint32_t *)(PSC0_BASE + 0x00))
#define PSC0_INTEVAL	*((volatile uint32_t *)(PSC0_BASE + 0x18))
#define PSC0_MERRPR0	*((volatile uint32_t *)(PSC0_BASE + 0x40))
#define PSC0_MERRCR0	*((volatile uint32_t *)(PSC0_BASE + 0x50))
#define PSC0_PERRPR	*((volatile uint32_t *)(PSC0_BASE + 0x60))
#define PSC0_PERRCR	*((volatile uint32_t *)(PSC0_BASE + 0x68))
#define PSC0_PTCMD	*((volatile uint32_t *)(PSC0_BASE + 0x120))
#define PSC0_PTSTAT	*((volatile uint32_t *)(PSC0_BASE + 0x128))
#define PSC0_PDSTAT0	*((volatile uint32_t *)(PSC0_BASE + 0x200))
#define PSC0_PDSTAT1	*((volatile uint32_t *)(PSC0_BASE + 0x204))
#define PSC0_PDCTL0	*((volatile uint32_t *)(PSC0_BASE + 0x300))
#define PSC0_PDCTL1	*((volatile uint32_t *)(PSC0_BASE + 0x304))
#define PSC0_PDCFG0	*((volatile uint32_t *)(PSC0_BASE + 0x400))
#define PSC0_PDCFG1	*((volatile uint32_t *)(PSC0_BASE + 0x404))
#define PSC0_MDSTAT(x)	*((volatile uint32_t *)(PSC0_BASE + 0x800 + (4*(x))))
#define PSC0_MDCTL(x)	*((volatile uint32_t *)(PSC0_BASE + 0xA00 + (4*(x))))


#define PSC1_REVID	*((volatile uint32_t *)(PSC1_BASE + 0x00))
#define PSC1_INTEVAL	*((volatile uint32_t *)(PSC1_BASE + 0x18))
#define PSC1_MERRPR0	*((volatile uint32_t *)(PSC1_BASE + 0x40))
#define PSC1_MERRCR0	*((volatile uint32_t *)(PSC1_BASE + 0x50))
#define PSC1_PERRPR	*((volatile uint32_t *)(PSC1_BASE + 0x60))
#define PSC1_PERRCR	*((volatile uint32_t *)(PSC1_BASE + 0x68))
#define PSC1_PTCMD	*((volatile uint32_t *)(PSC1_BASE + 0x120))
#define PSC1_PTSTAT	*((volatile uint32_t *)(PSC1_BASE + 0x128))
#define PSC1_PDSTAT0	*((volatile uint32_t *)(PSC1_BASE + 0x200))
#define PSC1_PDSTAT1	*((volatile uint32_t *)(PSC1_BASE + 0x204))
#define PSC1_PDCTL0	*((volatile uint32_t *)(PSC1_BASE + 0x300))
#define PSC1_PDCTL1	*((volatile uint32_t *)(PSC1_BASE + 0x304))
#define PSC1_PDCFG0	*((volatile uint32_t *)(PSC1_BASE + 0x400))
#define PSC1_PDCFG1	*((volatile uint32_t *)(PSC1_BASE + 0x404))
#define PSC1_MDSTAT(x)	*((volatile uint32_t *)(PSC1_BASE + 0x800 + (4*(x))))
#define PSC1_MDCTL(x)	*((volatile uint32_t *)(PSC1_BASE + 0xA00 + (4*(x))))


void psc_init(void);
#endif
